--Camera
--By Kylegar

ENT.Type = "anim"

if(SERVER) then
 AddCSLuaFile("shared.lua")
 
 function ENT:Initialize()

  end
  
  
  function ENT:SettargPlayer(ply)
  if !(ply:IsPlayer()) then return end
  self.rzPlayer = ply
  local backvec = ply:GetAngles():Forward() * -15
  self.Entity:SetPos(ply:GetPos()+Vector(0,0,350)+ Vector(backvec.x,backvec.y,0))
  local plyang = ply:GetAngles()
  local lookang = Angle(60,plyang.y,plyang.r)
  
  self.Entity:SetParent(ply)
  self.Entity:SetAngles(lookang)
  ply:SetCamera(self.Entity)
  end
  
  function ENT:Think()
    if !(self.rzPlayer) then return end
	local plyang = self.rzPlayer:GetAngles()
    local lookang = Angle(60,plyang.y,plyang.r)
     self.Entity:SetAngles(lookang)
	 local ply = self.rzPlayer
	local backvec = ply:GetAngles():Forward() * -15
    self.Entity:SetPos(ply:GetPos()+Vector(0,0,350)+ Vector(backvec.x,backvec.y,0))
	
	
	
  end
end

if(CLIENT) then
	function ENT:Draw()
	end
end